package com.lu.widgets.demo;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.TabHost;
import android.widget.TextView;

import com.lu.widgets.R;
import com.lu.widgets.component.tab.ToolKitTabHost;

public class ToolkitTabHostTest extends Activity {

	/** Called when the activity is first created. */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tab_layout);
		ToolKitTabHost toolkitTabhost = (ToolKitTabHost) findViewById(R.id.toolkitTabhost);
		toolkitTabhost.setup();
		toolkitTabhost.addTab(toolkitTabhost.newTabSpec("tab_1").setContent(
				R.id.tab_1));
		toolkitTabhost.addTab(toolkitTabhost.newTabSpec("tab_2").setContent(
				R.id.tab_2));
		toolkitTabhost.addTab(toolkitTabhost.newTabSpec("tab_3").setContent(
				R.id.tab_3));

		TabHost tabhost = (TabHost) findViewById(android.R.id.tabhost);
		tabhost.setup();
		TextView tv = (TextView) LayoutInflater.from(this).inflate(
				R.layout.toolkit_tab, null, false);
		tv.setText("tab1");
		tabhost.addTab(tabhost.newTabSpec("tab1").setIndicator(tv)
				.setContent(R.id.tab1));
		tv = (TextView) LayoutInflater.from(this).inflate(R.layout.toolkit_tab,
				null, false);
		tv.setText("tab2");
		tabhost.addTab(tabhost.newTabSpec("tab2").setIndicator(tv)
				.setContent(R.id.tab2));
		tv = (TextView) LayoutInflater.from(this).inflate(R.layout.toolkit_tab,
				null, false);
		tv.setText("tab3");
		tabhost.addTab(tabhost.newTabSpec("tab3").setIndicator(tv)
				.setContent(R.id.tab3));
	}
}
